




	******************************************************************
	**
	**
	**		NAME:	ELITE PERSISTENCE IN THE ERA OF EXPANDING OVERSEAS TRADE
	**
	**		MAKES:  Figures Appendix F1-4 (a) and (b) 		       
	**		
	**
	******************************************************************
	
	
	
	
	

			

		
			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**
	


*-------------------------------------------------------------------------------
* global for input/output
*-------------------------------------------------------------------------------


* input
*------

global input = "" 	
	
	
* output
*-------

global output = ""	
		
	
	
			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**
	


*-------------------------------------------------------------------------------
* preliminaries
*-------------------------------------------------------------------------------


* preliminaries
*--------------

clear
set more off






			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**
	


*-------------------------------------------------------------------------------
* data
*-------------------------------------------------------------------------------

* input
*------

cd ${input}
use analysis_vars_parl.dta, clear





			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**
	


*-------------------------------------------------------------------------------
* assert
*-------------------------------------------------------------------------------


* assert
*-------

assert 	parl_year >= 1536 & parl_year <= 1760


duplicates tag parl_group, gen(tt)
assert tt == 0 if parl_group != .
drop tt






			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**
	


*-------------------------------------------------------------------------------
* globals
*-------------------------------------------------------------------------------


* globals
*--------

global yr1 		= "parl_year > 1553 & parl_year < 1639"
global yr2 		= "parl_year >= 1660 & parl_year <= 1756"

global yr3 		= "parl_year >= 1639 & parl_year <= 1649"
global yr4 		= "parl_year >= 1628 & parl_year <= 1660"

global yr5 		= "parl_year < 1639 & parl_year >= 1583"
global yr6 		= "parl_year > 1550 & parl_year <= 1750"

global yr7 		= "parl_year > 1553 & parl_year <= 1640"


global xline1	= "xline(1660, lcolor(gs12))"
global xline2	= "xline(1688, lcolor(gs12) lpattern(line) )"
global xline3	= "xline(1640, lcolor(gs12))"
global xline4	= "xline(1562, lcolor(gs12)  lpattern(line) )"


	



			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**
	


*-------------------------------------------------------------------------------
* plot:  trend in shares of commercial (FIGURE F1-F4 a and b)
*-------------------------------------------------------------------------------



* hi lo
*------

capture drop hi 
capture drop lo

gen hi = 100
gen lo = 0
global scale = "0(20)100"




* loop over types
*----------------

local merchanttypes "east newworld passasia passnewworld"

local types = "aris dynasn"


foreach m in `merchanttypes' {
foreach t in `types' {


	if "`t'" == "aris" {
		local y_type_label = "w/ Aristocratic Connections"
	}
	
	
	if "`t'" == "dynasn" {
		local y_type_label = "w/ Pre-existing Surnames"
	}

	
	if "`m'" == "east" {
		local merchant_label "% MPs Occupied in Overseas Trade to Asia"
	}

	
	if "`m'" == "newworld" {
		local merchant_label "% MPs Occupied in Overseas Trade to the Americas"
	}


	if "`m'" == "east" {
		global weight1 = "int_intl_east_tot"
	}


	if "`m'" == "newworld" {
		global weight1 = "int_intl_newworld_tot"
	}


	if "`m'" == "passasia" {
		global weight1 = "pass_byparl_asia_tot"
	}

	
	if "`m'" == "passnewworld" {
		global weight1 = "pass_byparl_newworld_tot"
	}




* this plot
*----------

global outcome1 = "share_`m'_`t'"

gen ${outcome1}_pct = ${outcome1} * 100

gen control = share_nonactpasscomm_`t'
gen control_pct = control * 100






* plot
*-----

local bwidth = 10

# delimit ;

twoway 
	
	
		// shaded area
	(rarea hi lo parl_year	
		if   ${yr3} 
		,  color(gs12) )
		
		

	(lpoly ${outcome1}_pct parl_year [fweight=${weight1}]
		if   ${yr1}		
		,  bwidth(`bwidth')	fcolor(none) alcolor(gs2) alpattern(dot) alwidth(thick)
			  lcolor(gs5)  lwidth(medthick) lpattern(shortdash)
			    ${xline2}  ${xline4}
			) 
	(lpoly ${outcome1}_pct parl_year [fweight=${weight1}]
		if   ${yr2}	
		,  bwidth(`bwidth')
		lcolor(gs5)  lwidth(medthick) lpattern(shortdash) 
			)

			
			
			
	(lpoly control_pct parl_year
		if   ${yr1}		
		,  bwidth(`bwidth')	lcolor(gs1)  lwidth(medthick) lpattern(line) 
			
			) 
	(lpoly control_pct parl_year
		if   ${yr2}		
		,  bwidth(`bwidth') lcolor(gs1)  lwidth(medthick) lpattern(line)  

			)

	(scatter ${outcome1}_pct parl_year [fw=${weight1}]
		if    ${yr6}		
		,  mcolor(gs5) msymbol(Oh))
	
		
		
		
		
		
	(scatter control_pct parl_year 
		if    ${yr1}		
		,  mcolor(gs1) msymbol(o))
	(scatter control_pct parl_year 
		if    ${yr2}			
		,  mcolor(gs1) msymbol(o))	
		
		
		
		,
		yscale(noline)
		xscale(noline)

		
		xsize(8.5)
		ysize(3)

		title("", color(black) size(medsmall) pos(11) ) 
		xlab( 1550(25)1750, 
			labsize(medsmall) nogrid ) 
		ylab( ${scale}, 
			angle(hori) labsize(medsmall) nogrid  )
		xtitle("Year" , 
			color(black) size(large) )
		ytitle("Percentage of MPs" ,
			color(black) size(large)  )
		graphregion( fcolor(white) lcolor(white) ) 
		plotregion( fcolor(white) lstyle(none) lcolor(white) ilstyle(none)) 
		legend(
			order(
				2 "`merchant_label' `y_type_label'"
				4 "% Non-commerical MPs `y_type_label'"
				)
			cols(1)
			pos(6)
			
			region( color(none) )
			size(large)
			)
		
		;

# delimit cr


	drop ${outcome1}_pct ${outcome1} control control_pct


	
	
	
	* export graph
	*-------------



	cd "${output}"
	graph export "trend_share_`m'_`t'_new.pdf", replace
}
}	







			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**
	

						** end of do file ** 	
	
	